package test2;

import java.io.File;
import java.io.Reader;
import java.util.ArrayList;

public class Test {
    public static void main(String[] args) {
        ArrayList<File> list = new ArrayList<>();
        File file = new File("D:\\Develop\\feiq\\Recv Files\\day14_多线程01(1)");
        list = addFile(list, file);
        for (File f : list) {

//            System.out.println(f);

            ReaderDao dao = new ReaderDao(f);
            dao.start();
        }
    }

    private static ArrayList<File> addFile(ArrayList<File> list, File file) {
        if (file==null){
            return null;
        }
        File[] files = file.listFiles();
        for (File f : files) {
            if (f.isFile()) {
                list.add(f);
            } else {
                addFile(list, f);
            }
        }
        return list;
    }
}
